package com.xncoding.encrypt.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xncoding.encrypt.annotation.DataMasking;
import com.xncoding.encrypt.annotation.Sensitive;
import com.xncoding.encrypt.enums.DataMaskingFunc;
import com.xncoding.encrypt.enums.SensitiveStrategy;
import com.xncoding.encrypt.enums.UserType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private Integer id;
    @DataMasking(maskFunc = DataMaskingFunc.ALL_MASK)
    private String name;
    /**
     * 邮箱
     */
    @DataMasking(maskFunc = DataMaskingFunc.ALL_MASK)
    private String email;

    private UserType userType = UserType.COMMON;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime registerTime;

    @Sensitive(strategy = SensitiveStrategy.PHONE)
    private String phone;

    @Sensitive(strategy = SensitiveStrategy.ID_CARD)
    private String identifyCard;

    @Sensitive(strategy = SensitiveStrategy.ADDRESS)
    private String address;

}